<script>
  import { beforeNavigate } from '$app/navigation'
  import '../app.css'
  let { children } = $props()
  import authPermission from '$lib/utils/routeGuard.js';

  beforeNavigate(async ({ to, cancel }) => {
    const pathname = to.url.pathname;
    authPermission(pathname, cancel);
  })
</script>

<svelte:head>
  <title>Svelte App</title>
  <link rel="icon" href="/favicon.ico" />
</svelte:head>

<main>{@render children?.()}</main>
